package top.zhimingw.tankgame3;

import javax.swing.*;

/**
 * @Author:zhimingw
 * @Version 1.0
 */
public class ZhimingwTankGame03 extends JFrame {

    //定义一个MyPanel
    MyPanel mp = null;
    public static void main(String[] args) {
        ZhimingwTankGame03 zhimingwTankGame01 = new ZhimingwTankGame03();

    }

    public ZhimingwTankGame03(){
        mp = new MyPanel();
        //将mp放入Thread
        Thread thread = new Thread(mp);
        thread.start();
        this.add(mp);
        this.add(mp);
        this.setSize(1200,950);
        this.addKeyListener(mp);//监听键盘事件
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
    }

}
